package com.esp.web;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import com.esp.service.impl.LinkShareDataServiceImpl;

@Controller
public class SearchController {
	@Autowired
	private LinkShareDataServiceImpl linkShareDataService;
	
	@RequestMapping(value="/search",method=RequestMethod.GET)
	public String showHomePage(@RequestParam("searchString") String searchString, Model model){
		model.addAttribute("items", linkShareDataService.getItemsForSearch(searchString));
		return "home";
	}
}
